package com.guoxin.chapter3.join.joinsleep1;

import java.util.concurrent.TimeUnit;

/**
 * @author guoxin
 * @date 2019年8月23日
 */
public class ThreadB extends Thread {
	@Override
	public void run() {
		try {
			System.out.println("b run begin timer=" + System.currentTimeMillis());
			TimeUnit.SECONDS.sleep(5);
			System.out.println("b run end tiemr=" + System.currentTimeMillis());
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
	}
	
	public synchronized void bService(){
		System.out.println("打印了 BService timer="+System.currentTimeMillis());
	}
}
